<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model app\models\ContactForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;

$this->title = '联系我们';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-banner page-banner-contact">
    <h1><?=Html::decode($this->title)?></h1>
</div>
<!--/page-banner-->
<ul class="box-main page-nav">
    <li><a href="<?=Yii::$app->homeUrl?>"><?=Yii::$app->name?></a></li>
    <li><span><?=Html::decode($this->title)?></span></li>
</ul>
<!--/page-nav-->
<div class="box-main box-white clearfix">
    <div class="contact-main pa-15">
        <div class="item">
            <div class="icon">
                <i class="fa fa-phone"></i>
            </div>
            <div class="con">
                <h6>联络电话</h6>
                <p><span class="num"><?=Yii::$app->config->get('sys_phone')?></span></p>
            </div>
        </div>
        <!---->
        <div class="item">
            <div class="icon">
                <i class="fa fa-map-marker"></i>
            </div>
            <div class="con">
                <h6>公司地址</h6>
                <p><?=Yii::$app->config->get('sys_address')?></p>
            </div>
        </div>
        <!---->
        <div class="item">
            <div class="icon">
                <i class="fa fa-wechat"></i>
            </div>
            <div class="con">
                <h6>微信</h6>
                <p><?=Yii::$app->config->get('sys_wx')?></p>
            </div>
        </div>
        <!---->
        <div class="item">
            <div class="icon">
                <i class="fa fa-envelope-o"></i>
            </div>
            <div class="con">
                <h6>电子邮箱</h6>
                <p><a href="mailto:<?=Yii::$app->config->get('sys_site_email')?>"><?=Yii::$app->config->get('sys_site_email')?></a></p>
            </div>
        </div>
        <!---->
    </div>
    <!--/contact-main-->
    <div class="contact-map">
        <div id="boxMap" style="width: 540px; height: 520px;"></div>
    </div>
    <!--/contact-map-->
</div>
<!--/box-main-->
<div class="contact-form contact-form-page mt-40">
<?=$this->render('../layouts/contact-form', ['mailForm' => $mailForm])?>
</div>
<?php
$lat_long = explode(',',Yii::$app->config->get('sys_lat_long'));
$lat = isset($lat_long[0]) ? $lat_long[0] : '22.2551400000';
$long = isset($lat_long[1]) ? $lat_long[1] : '113.5881800000';
$mapJS = <<< MAPEOF
    var lat = Number('{$lat}');
    var long = Number('{$long}');
    var map = new AMap.Map("boxMap", {
        resizeEnable: true,
        center: [long,lat],
        zoom: 20,
    });
    <!--var str = '';-->
    <!--str += '<div class="contact-popup"><div class="info">';-->
    <!--str += '<h5>珠海天空网络科技有限公司</h5>';-->
    <!--str += '<p>地址：珠澳跨境工业区珠海园区5-1号地鸿丰大厦二楼201B-207B</p>';-->
    <!--str += '</div>';-->
    <!--str += '<div class="ways row">';-->
    <!--str += '<div class="col-xs-6">';-->
    <!--str += '<i class="icon icon-phone"></i> <span>0756-8823030</span>';-->
    <!--str += '</div>';-->
    <!--str += '<div class="col-xs-6">';-->
    <!--str += '<i class="icon icon-mail2"></i> <span><a href="mailto:sales03@zh-sky.com">sales03@zh-sky.com</a></span> ';-->
    <!--str += '</div>';-->
    <!--str += '<div class="col-xs-6">';-->
    <!--str += '<i class="icon icon-fax"></i> <span>0756-8823949</span>';-->
    <!--str += '</div>';-->
    <!--str += '<div class="col-xs-6">';-->
    <!--str += '<i class="icon icon-qq2"></i> <span><a href="#" class="btn btn-white-line">点击在线咨询</a></span>';-->
    <!--str += '</div></div>';-->
    <!--str += '<div class="arrow"></div>';-->
    <!--str += '</div>';-->
    var marker = new AMap.Marker({
        map: map,
        position: [long,lat],
        offset: new AMap.Pixel(40, -100),
        draggable: false,
        //content: str
    });
MAPEOF;

$this->registerJsFile('http://webapi.amap.com/maps?v=1.3&key=277b6f260405b5315653a013332d5835');
$this->registerJs($mapJS);